﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/myFinance.Master" AutoEventWireup="true" CodeBehind="SaveCategory.aspx.cs" Inherits="myFinance.Web.Views.Category.SaveCategory" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">   
  <script type="text/javascript">    
     $(document).ready(function()
     {
        $("#savecategory").validate();        
   
        $("#adminmenu li a").removeClass("current");
        $("#category").addClass("current");
        var elements = $("input[type!='submit'], textarea, select");
        elements.focus(function(){
        $(this).parents('p').addClass('highlight');
        });
        elements.blur(function(){
        $(this).parents('p').removeClass('highlight'); 
        });    
       }); 
 </script>
 
 <style type="text/css">
 .block { display: block; }
#category label.error {
	display: none;
}
</style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">    
	<form id="savecategory" action="<%=Url.Action("Save","Category")%>" method="post">
	<p>&nbsp;</p>
   <fieldset id="category">    	
   <legend>Add/EDIT Category</legend>  
  <table cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <div class="inputfields">       

                    <p>
                        <label for="title">Name</label>
                        <%=Html.TextBox("Name", ViewData["Name"], new { id="name", @class="text required"})%>
                         <%=Html.ValidationMessage("Name")%>
                    </p>
                    <p>
                        <label for="body">Description</label>
                        <%=Html.TextArea("Description", new { id = "description", rows = "4", @class = "text required" })%>
                          <%=Html.ValidationMessage("Description")%>
                       
                    </p>  
                   
                    <p>
                     <label for="Categoryradio">Category Type</label>
                     </p>                                     
                      <%=Html.RadioButton("CategoryType", "Expense", new { validate = "required:true" })%>Expense 
                      <%=Html.RadioButton("CategoryType","Revenue")%>Revenue
                      
                      <%=Html.ValidationMessage("CategoryType")%>
                      <label for="CategoryType" class="error">Please select at least one category</label>
  
                   <p>
                    <button type="submit">
                    <img src="../../Content/icons/tick.png" alt="" />Save
                </button>    
                    
                    </p>
                   
                     <% if (ViewData.Model != null)
                        {%>
                             <input type="hidden" name="CID" value="<%=ViewData.Model.ID %>" id="id" />
                         <%}%>                  
           
            </div>
            </td></tr>                   
    </table>   
     </fieldset>
</form>
</asp:Content>
